﻿@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>Huant的授权应用</title>
    <link href="~/favicon.ico" rel="shortcut icon" type="image/x-icon" />
        @Styles.Render("~/Content/themes")
    <link href="~/Content/zTree_v3/css/zTreeStyle/zTreeStyle.css" rel="stylesheet" />

    <script src="~/Content/jquery-easyui-1.3.6/jquery.min.js"></script>
    <script src="~/Content/jquery-easyui-1.3.6/jquery.easyui.min.js"></script>
    <script src="~/Content/zTree_v3/js/jquery.ztree.all-3.5.min.js"></script>
    <script src="~/Content/jquery-easyui-1.3.6/locale/easyui-lang-zh_CN.js"></script>

    <script type="text/javascript">
        function PageUrl(event, treeId, treeNode) {
            if (treeNode.Url != '') {
                $('body').layout('panel', 'center').panel({
                    href: treeNode.Url
                });
            } 
        }

        function GetTreeJson(obj) {
            $.post('/AuthFunction/GetAuthFunctionByParentUnid?parentUnid=' + obj,
                    function (result) {
                        $.fn.zTree.init($('#' + obj), {
                            data: {
                                key: {
                                    name: 'FunctionName'
                                },
                                simpleData: {
                                    enable: true,
                                    idKey: 'Unid',
                                    pIdKey: 'ParentUnid',
                                }
                            },
                            callback: {
                                onClick: PageUrl
                            }
                        }, result);
                    }
               , 'json');
        }
    </script>
</head>
<body class="easyui-layout">
    <div data-options="region:'north',split:true" style="height: 70px; background-color:#eee;text-align:center">
        <h2>授权应用</h2>
    </div>

    <div data-options="region:'south',split:true" style="height: 30px; background-color: #eee;text-align:center">
        Copyright &copy;2014 Huant
    </div>

    <div data-options="region:'west',split:true,iconCls:'icon-large-smartart'" title="菜单列表" style="width:200px;">
        <div class="easyui-accordion" data-options="fit:true">
            @foreach (var authFunction in ViewBag.afList)
            {
                <div title=@authFunction.FunctionName data-options="" style="overflow:auto">
                    <ul id="@authFunction.Unid" class="ztree"></ul>
                </div>
                <script type="text/javascript">
                    GetTreeJson(@authFunction.Unid);
                </script>
            }
        </div>
    </div>

    <div id="content" data-options="region:'center',title:'操作界面',iconCls:'icon-large-smartart',split:true"></div>
</body>
</html>
